#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int sss=0,www=1;
	char chh=getchar();
	while(chh<'0'||chh>'9'){
		if(chh=='-') www=-1;
		chh=getchar();
	}
	while(chh>='0'&&chh<='9'){
		sss=sss*10+chh-'0';
		chh=getchar();
	}
	return sss*www;
}
int n;
int a[200005];
signed main(){
	freopen("pockets.in","r",stdin);
	freopen("pockets.out","w",stdout);
	n=read();
	for(register int i=1;i<n;i++) a[i]=read();
	if(n==3){
		int q=read();
		while(q--){
			a[3]=read();
			cout<<a[1]+a[3]-a[2]<<"\n";
		}
	}
	else {
		int q=read();
		while(q--){
			a[4]=read();
			cout<<a[1]+max(a[3],a[4])-a[2]-min(a[3],a[4])<<"\n";
		}
	}
	return 0;
}
